<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>






<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Style-Type" content="text/css">
<link href="dhcpd.leases.5_fichiers/man.css" type="text/css" rel="stylesheet">
<link href="http://www.daemon-systems.org/man/index.html" rel="Index"><title>dhcpd.leases.5</title></head><body>

<pre>dhcpd.leases(5)                                                dhcpd.leases(5)



<strong>NAME</strong>
       dhcpd.leases - DHCP client lease database

<strong>DESCRIPTION</strong>
       The Internet Systems Consortium DHCP Server keeps a persistent database
       of leases that it has assigned.  This database  is  a  free-form  ASCII
       file  containing a series of lease declarations.  Every time a lease is
       acquired, renewed or released, its new value is recorded at the end  of
       the  lease  file.   So if more than one declaration appears for a given
       lease, the last one in the file is the current one.

       When dhcpd is first installed, there is no lease  database.    However,
       dhcpd  requires  that a lease database be present before it will start.
       To make the initial lease database, just create an  empty  file  called
       /var/db/dhcpd.leases.   You can do this with:

            touch DBDIR/dhcpd.leases

       In  order to prevent the lease database from growing without bound, the
       file is rewritten from time to time.   First, a temporary  lease  data-
       base  is created and all known leases are dumped to it.   Then, the old
       lease database is renamed /var/db/dhcpd.leases~.   Finally,  the  newly
       written lease database is moved into place.

<strong>FORMAT</strong>
       Lease  descriptions  are  stored in a format that is parsed by the same
       recursive  descent  parser  used  to   read   the   <strong><a href="http://www.daemon-systems.org/man/dhcpd.conf.5.html">dhcpd.conf(5)</a></strong>   and
       <strong><a href="http://www.daemon-systems.org/man/dhclient.conf.5.html">dhclient.conf(5)</a></strong>  files.   Lease  files can contain lease declarations,
       and  also  group  and  subgroup  declarations,  host  declarations  and
       failover state declarations.  Group, subgroup and host declarations are
       used to record objects created using the OMAPI protocol.

       The lease file is a log-structured file - whenever a lease changes, the
       contents of that lease are written to the end of the file.   This means
       that it is entirely possible and quite reasonable for there to  be  two
       or  more  declarations  of the same lease in the lease file at the same
       time.   In that case,  the  instance  of  that  particular  lease  that
       appears last in the file is the one that is in effect.

       Group,  subgroup and host declarations in the lease file are handled in
       the same manner, except that if any of these  objects  are  deleted,  a
       <span class="underline">rubout</span>  is  written to the lease file.   This is just the same declara-
       tion, with <strong>{</strong> <strong>deleted;</strong> <strong>}</strong> in the scope of  the  declaration.    When  the
       lease  file  is  rewritten, any such rubouts that can be eliminated are
       eliminated.   It is possible to delete a declaration in the  <strong>dhcpd.conf</strong>
       file;  in  this  case,  the  rubout  can  never  be eliminated from the
       <strong>dhcpd.leases</strong> file.

<strong>THE</strong> <strong>LEASE</strong> <strong>DECLARATION</strong>
       <strong>lease</strong> <span class="underline">ip-address</span> <strong>{</strong> <span class="underline">statements...</span> <strong>}</strong>

       Each lease declaration includes the single IP  address  that  has  been
       leased  to  the  client.    The statements within the braces define the
       duration of the lease and to whom it is assigned.

       <strong>starts</strong> <span class="underline">date</span><strong>;</strong>
       <strong>ends</strong> <span class="underline">date</span><strong>;</strong>
       <strong>tstp</strong> <span class="underline">date</span><strong>;</strong>
       <strong>tsfp</strong> <span class="underline">date</span><strong>;</strong>

       The start and end time of a lease are recorded  using  the  <strong>starts</strong>  and
       <strong>ends</strong> statements.   The <strong>tstp</strong> statement is specified if the failover pro-
       tocol is being used, and indicates what time the peer has been told the
       lease  expires.    The <strong>tsfp</strong> statement is also specified if the failover
       protocol is being used, and indicates the lease expiry  time  that  the
       peer has acknowledged.   The <span class="underline">date</span> is specified as follows:

       <span class="underline">weekday</span> <span class="underline">year</span><strong>/</strong><span class="underline">month</span><strong>/</strong><span class="underline">day</span> <span class="underline">hour</span><strong>:</strong><span class="underline">minute</span><strong>:</strong><span class="underline">second</span>

       The weekday is present to make it easy for a human to tell when a lease
       expires - it's specified as a number from zero to six, with zero  being
       Sunday.   The  day  of week is ignored on input.  The year is specified
       with the century, so it should generally  be  four  digits  except  for
       really long leases.  The month is specified as a number starting with 1
       for January.  The day of the month is likewise specified starting  with
       1.   The hour is a number between 0 and 23, the minute a number between
       0 and 59, and the second also a number between 0 and 59.

       Lease times are specified in Coordinated Universal Time (UTC),  not  in
       the  local time zone.  There is probably nowhere in the world where the
       times recorded on a lease are always the same as wall clock times.   On
       most  unix  machines, you can display the current time in UTC by typing
       <strong>date</strong> <strong>-u</strong>.

       If a lease will never expire, <span class="underline">date</span> is <strong>never</strong> instead of an actual  date.

       <strong>hardware</strong> <span class="underline">hardware-type</span> <span class="underline">mac-address</span><strong>;</strong>

       The hardware statement records the MAC address of the network interface
       on which the lease will be used.   It is specified as a series of hexa-
       decimal octets, separated by colons.

       <strong>uid</strong> <span class="underline">client-identifier</span><strong>;</strong>

       The  <strong>uid</strong>  statement records the client identifier used by the client to
       acquire the lease.   Clients are not required to  send  client  identi-
       fiers,  and  this statement only appears if the client did in fact send
       one.   Client identifiers are normally an ARP  type  (1  for  ethernet)
       followed  by  the MAC address, just like in the <strong>hardware</strong> <span class="underline">statement,</span> <span class="underline">but</span>
       <span class="underline">this</span> <span class="underline">is</span> <span class="underline">not</span> <span class="underline">required.</span>

       The client identifier is recorded as a colon-separated hexadecimal list
       or  as  a  quoted string.   If it is recorded as a quoted string and it
       contains one or more non-printable  characters,  those  characters  are
       represented  as octal escapes - a backslash character followed by three
       octal digits.

       <strong>client-hostname</strong> <span class="underline">hostname</span> <strong>;</strong>

       Most DHCP clients will send their hostname in the <span class="underline">host-name</span> option.  If
       a  client  sends  its hostname in this way, the hostname is recorded on
       the lease with a <strong>client-hostname</strong> statement.   This is not  required  by
       the  protocol,  however, so many specialized DHCP clients do not send a
       host-name option.

       <strong>abandoned;</strong>

       The <strong>abandoned</strong> statement indicates that the DHCP  server  has  abandoned
       the  lease.    In  that  case,  the <strong>abandoned</strong> statement will be used to
       indicate that the lease should  not  be  reassigned.   Please  see  the
       <strong><a href="http://www.daemon-systems.org/man/dhcpd.conf.5.html">dhcpd.conf(5)</a></strong> manual page for information about abandoned leases.

       <strong>binding</strong> <strong>state</strong> <span class="underline">state</span><strong>;</strong> <strong>next</strong> <strong>binding</strong> <strong>state</strong> <span class="underline">state</span><strong>;</strong>

       The  <strong>binding</strong>  <strong>state</strong> statement declares the lease's binding state.  When
       the DHCP server is not configured  to  use  the  failover  protocol,  a
       lease's  binding  state  will  be either <strong>active</strong> or <strong>free</strong>.   The failover
       protocol adds some additional  transitional  states,  as  well  as  the
       <strong>backup</strong>  state,  which indicates that the lease is available for alloca-
       tion by the failover secondary.

       The <strong>next</strong> <strong>binding</strong> <strong>state</strong> statement indicates what state  the  lease  will
       move  to  when  the  current state expires.   The time when the current
       state expires is specified in the <span class="underline">ends</span> statement.

       <strong>option</strong> <strong>agent.circuit-id</strong> <span class="underline">string</span>; <strong>option</strong> <strong>agent.remote-id</strong> <span class="underline">string</span>;

       The <strong>option</strong> <strong>agent.circuit-id</strong> and <strong>option</strong> <strong>agent.remote-id</strong>  statements  are
       used  to  record the circuit ID and remote ID options send by the relay
       agent, if the relay agent uses  the  <span class="underline">relay</span>  <span class="underline">agent</span>  <span class="underline">information</span>  <span class="underline">option</span>.
       This allows these options to be used consistently in conditional evalu-
       ations even when the client is contacting the  server  directly  rather
       than through its relay agent.

       <strong>set</strong> <span class="underline">variable</span> <strong>=</strong> <span class="underline">value</span><strong>;</strong>

       The  <strong>set</strong> statement sets the value of a variable on the lease.  For gen-
       eral information on variables, see the <strong><a href="http://www.daemon-systems.org/man/dhcp-eval.5.html">dhcp-eval(5)</a></strong> manual page.

       <strong>The</strong> <span class="underline">ddns-text</span> <strong>variable</strong>

       The <span class="underline">ddns-text</span> variable is used to record the value of the client's  TXT
       identification  record when the interim ddns update style has been used
       to update the DNS for a particular lease.

       <strong>The</strong> <span class="underline">ddns-fwd-name</span> <strong>variable</strong>

       The <span class="underline">ddns-fwd-name</span> <strong>variable</strong> <strong>records</strong> <strong>the</strong> <strong>value</strong> <strong>of</strong> <strong>the</strong> <strong>name</strong> <strong>used</strong> <strong>in</strong> <strong>updat-</strong>
       <strong>ing</strong>  <strong>the</strong>  <strong>client's</strong> <strong>A</strong> <strong>record</strong> <strong>if</strong> <strong>a</strong> <strong>DDNS</strong> <strong>update</strong> <strong>has</strong> <strong>been</strong> <strong>successfully</strong> <strong>done</strong>
       <strong>by</strong> <strong>the</strong> <strong>server.</strong>   <strong>The</strong> <strong>server</strong> <strong>may</strong> <strong>also</strong> <strong>have</strong> <strong>used</strong> <strong>this</strong> <strong>name</strong> <strong>to</strong> <strong>update</strong>  <strong>the</strong>
       <strong>client's</strong> <strong>PTR</strong> <strong>record.</strong>

       <strong>The</strong> <span class="underline">ddns-client-fqdn</span> <strong>variable</strong>

       If  the  server is configured to use the interim ddns update style, and
       is also configured to allow clients to update their own fqdns, and  the
       client did in fact update its own fqdn, then the <span class="underline">ddns-client-fqdn</span> vari-
       able records the name that the client has indicated it is using.   This
       is  the  name that the server will have used to update the client's PTR
       record in this case.

       <strong>The</strong> <span class="underline">ddns-rev-name</span> <strong>variable</strong>

       If the server successfully updates the client's PTR record, this  vari-
       able will record the name that the DHCP server used for the PTR record.
       The name to which the PTR record points will be  either  the  <span class="underline">ddns-fwd-</span>
       <span class="underline">name</span> or the <span class="underline">ddns-client-fqdn</span>.

       <strong>on</strong>  <span class="underline">events</span>  <strong>{</strong> <span class="underline">statements...</span> <strong>}</strong> The <strong>on</strong> <span class="underline">statement</span> <span class="underline">records</span> <span class="underline">a</span> <span class="underline">list</span> <span class="underline">of</span> <span class="underline">state-</span>
       <span class="underline">ments</span> <span class="underline">to</span> <span class="underline">execute</span> <span class="underline">if</span> <span class="underline">a</span> <span class="underline">certain</span> <span class="underline">event</span> <span class="underline">occurs.</span>   <span class="underline">The</span> <span class="underline">possible</span> <span class="underline">events</span>  <span class="underline">that</span>
       <span class="underline">can</span>  <span class="underline">occur</span>  <span class="underline">for</span> <span class="underline">an</span> <span class="underline">active</span> <span class="underline">lease</span> <span class="underline">are</span> <strong>release</strong> and <strong>expiry</strong>.   More than one
       event can be specified - if so, the events are separated by '|' charac-
       ters.

<strong>THE</strong> <strong>FAILOVER</strong> <strong>PEER</strong> <strong>STATE</strong> <strong>DECLARATION</strong>
       The  state of any failover peering arrangements is also recorded in the
       lease file, using the <strong>failover</strong> <strong>peer</strong> statement:

       <strong>failover</strong> <strong>peer</strong> <span class="underline">name</span> <strong>state</strong> <strong>{</strong>
       <strong>my</strong> <strong>state</strong> <span class="underline">state</span> <strong>at</strong> <span class="underline">date</span><strong>;</strong>
       <strong>peer</strong> <strong>state</strong> <span class="underline">state</span> <strong>at</strong> <span class="underline">date</span><strong>;</strong>
       <strong>}</strong>

       The states of the peer named <span class="underline">name</span> is being recorded.   Both  the  state
       of  the  running server (<strong>my</strong> <strong>state</strong>) and the other failover partner (<span class="underline">peer</span>
       <span class="underline">state</span>) are recorded.   The  following  states  are  possible:  <strong>unknown-</strong>
       <strong>state</strong>,  <strong>partner-down</strong>,  <strong>normal</strong>,  <strong>communications-interrupted</strong>, <strong>resolution-</strong>
       <strong>interrupted</strong>,  <strong>potential-conflict</strong>,  <strong>recover</strong>,   <strong>recover-done</strong>,   <strong>shutdown</strong>,
       <strong>paused</strong>, and <strong>startup</strong>.  <strong>DBDIR/dhcpd.leases</strong>

<strong>SEE</strong> <strong>ALSO</strong>
       <a href="http://www.daemon-systems.org/man/dhcpd.8.html">dhcpd(8)</a>,   <a href="http://www.daemon-systems.org/man/dhcp-options.5.html">dhcp-options(5)</a>,   <a href="http://www.daemon-systems.org/man/dhcp-eval.5.html">dhcp-eval(5)</a>,   <a href="http://www.daemon-systems.org/man/dhcpd.conf.5.html">dhcpd.conf(5)</a>,  RFC2132,
       RFC2131.

<strong>AUTHOR</strong>
       <strong><a href="http://www.daemon-systems.org/man/dhcpd.8.html">dhcpd(8)</a></strong> was written by Ted Lemon under a  contract  with  Vixie  Labs.
       Funding  for  this project was provided by Internet Systems Consortium.
       Information  about  Internet  Systems  Consortium  can  be  found   at:
       <strong>http://www.isc.org/</strong>



                                                               <a href="http://www.daemon-systems.org/man/dhcpd.leases.5.html">dhcpd.leases(5)</a>
</pre>

<hr>

<div class="NetBSD-logo"><a href="http://www.netbsd.org/"><img alt="Site Driven by NetBSD" src="dhcpd.leases.5_fichiers/NetBSD.gif"></a></div>

</body></html>